home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8897 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.3 KB  |  51 lines

  1. Path: cs.tu-berlin.de!beinhart
  2. From: beinhart@cs.tu-berlin.de (Werner Henze)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: extern functions questions????????
  5. Date: 27 Feb 1996 08:48:25 GMT
  6. Organization: TU Berlin Fachbereich Informatik
  7. Message-ID: <4guggr$66b@news.cs.tu-berlin.de>
  8. References: <4gtug0$j3t@sunburst.ccs.yorku.ca>
  9. NNTP-Posting-Host: frieda.cs.tu-berlin.de
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=iso-8859-1
  12. Content-Transfer-Encoding: 8bit
  13. In-reply-to: KuMan's message of 27 Feb 1996 04:39:36 MET
  14.  
  15. In article <4gtug0$j3t@sunburst.ccs.yorku.ca> KuMan <" yu133496"@yorku.ca> writes:
  16.  
  17. >    I've this problem that I have to declare a class member function with two parameters(one 
  18. >    is a char pointer, the other is an int index). O.K. the problem is that the int index is also the 
  19. >    array index for that particular class.......
  20. >    class whatever{
  21. >        .    
  22. >        .
  23. >        add(int index, char *things);    // member function.
  24. >        .
  25. >        .
  26. >    }
  27. >    main(){
  28. >        .
  29. >        whatever x[20];        
  30. >        .
  31. >        .
  32. >        x.add[index](index, "hello");    //array index(main) is the 
  33. >                        //same member function index(add).
  34. >        .
  35. >        .
  36. >    }
  37. >    what can I do to make this function work??
  38. >    thank you
  39.  
  40. What about x[index].add(index, "hello"); ???
  41. "index" is an index into the array, not an index
  42. for the function add, right?
  43.  
  44. Ciao, Werner...
  45.  
  46. -- 
  47.